-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Move Host DB to SQL Impl #1804
Conversation
…ll/sql-host-db
…ll/sql-host-db
…ll/sql-host-impl
…b.com/ten-protocol/go-ten into will/sql-host-impl
…ll/sql-host-impl
…ll/sql-host-impl
…ll/sql-host-impl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the pain, Will.
The general pattern for transactions is:
tx:=startTransaction()
err:=doStuff1(tx)
if err!=nil{
tx.Rollback()
}
err:=doStuff2(tx)
if err!=nil{
tx.Rollback()
}
..
err:=doStuffN(tx)
if err!=nil{
tx.Rollback()
}
tx.Commit()
The code needs a bit more reshuffling in that area
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Will. I think functionally it looks good now.
I left a few comments around minor cosmetic issues. Then, it should be good to merge
@@ -196,7 +189,7 @@ func (h *host) Stop() error { | |||
} | |||
} | |||
|
|||
if err := h.db.Stop(); err != nil { | |||
if err := h.storage.Close(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BedrockSquirrel , I'm wondering why we didn't register the database as a service the first time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice work!
Why this change is needed
Tenscan Improvements
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks